package recharge_management

import (
	"context"

	"gitee.com/liuxuezhan/ar-platform/rpc-client/assetsClient/rpc"

	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/svc"
	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type QrBankDeleteLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

// qr_bank--删除
func NewQrBankDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QrBankDeleteLogic {
	return &QrBankDeleteLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *QrBankDeleteLogic) QrBankDelete(req *types.QrBankDeleteRequest) (resp *types.QrBankDeleteResponse, err error) {
	rpcReq := rpc.QrBankDeleteRequest{
		Id: req.Id,
	}

	rpcResp, err := l.svcCtx.AssetsRpc.TenantChannel.QrBankDelete(l.ctx, &rpcReq)
	if err != nil {
		return nil, err
	}

	return &types.QrBankDeleteResponse{
		CommonResp: types.CommonResp{
			Code:    rpcResp.CommonResp.Code,
			Message: rpcResp.CommonResp.Message,
		},
	}, nil
}
